<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #box1{
            width: 500px;
            height: 400px;
            margin: auto;
        }
        #box2{
            width: 100px;
            height: 100px;
            background: #000;
             margin-left: 40px;
        }
    </style>
</head>
<body>
   
      <div id="box1">
          <button onclick="a_height()">变高</button>
          <button onclick="a_width()">变长</button>
          <button onclick="a_red()">变色</button>
          <button onclick="a_none()">隐藏</button>
          <button onclick="a_block()">重置</button>
          <div id="box2"></div>
      </div>
    <script>
        var a=document.getElementById('box2')
        function  a_height() {
            a.style.height='220px'
        }
        function  a_width() {
            a.style.width='200px'
        }
        function  a_red() {
            a.style.background='red'
        }
        function  a_none() {
            a.style.display = 'none'
        }
        function  a_block() {
            a.style.display = 'block'
            a.style.height='100px'
            a.style.width='100px'
            a.style.background='#000'
        }
    </script>
</body>
</html>